from django.conf.urls.defaults import *
# Uncomment the next two lines to enable the admin:
from django.contrib import admin

import os
# set the cross platform path for 'document_root'
here_cross = lambda x: os.path.join(os.path.abspath(os.path.dirname(__file__)), *x)
PROJECT_ROOT = here_cross('.')
HIS_TEMPLATE_ROOT = here_cross(('template/HIS', ))

admin.autodiscover()

urlpatterns = patterns('DB_WORK.HIS.views',
    # Example:
    # (r'^DB_WORK/', include('DB_WORK.foo.urls')),

    # Uncomment the admin/doc line below and add 'django.contrib.admindocs' 
    # to INSTALLED_APPS to enable admin documentation:
    # (r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    # (r'^$', 'django.views.static.serve', {'document_root':DOCUMENT_ROOT, 'path':'index.html'}),
    (r'^$', 'sign_in'),
    (r'^login/$', 'sign_in'),
    (r'^patient/(?P<username>\w{0,30})/$', 'patient'),
    (r'^doctor/(?P<username>\w{0,30})/$', 'doctor'),
    (r'^department$', 'department'),
	(r'^medicine$', 'medicine'),
	(r'^diagnose$', 'diagnose'),
	(r'^(?P<role>\w{0,30})/(?P<username>\w{0,30})/view_diagnosis$', 'view_diagnosis'),
	(r'^appointment$', 'appointment'),
	(r'^(?P<role>\w{0,30})/(?P<username>\w{0,30})/view_appointment$', 'view_appointment'),
	(r'^logout$', 'logout_view'),
)

urlpatterns += patterns('',
	(r'^(?P<path>\w{0,256}.css)/$', 'django.views.static.serve', {'document_root': HIS_TEMPLATE_ROOT}),
)

urlpatterns += patterns('',
    (r'^admin/', include(admin.site.urls)),
)